<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>首页</title>
</head>
<body>

{% if request.session.username %}
    <p>
        欢迎 {{ request.session.username }}
    </p>
    <p>
        <a href="/user/logout">退出登录</a>
    </p>
    <p>
        <a href=" ">进入我的笔记</a>
    </p>
{% else %}
    {% if request.COOKIES.username %}
    <p>
        欢迎 {{ request.COOKIES.username }}
    </p>
    <p>
        <a href="/user/logout">退出登录</a>
    </p>
    <p>
        <a href=" ">进入我的笔记</a>
    </p>
{% else %}
    <p>
        <a href="/user/login">登录</a>
    </p>
    <p>
        <a href="/user/reg">注册</a>
    </p>
    {% endif %}
{% endif %}

</body>
</html>